package com.mbyte.easy.admin.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mbyte.easy.admin.entity.*;
import com.mbyte.easy.security.entity.SysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author lp
 * @since 2019-12-12
 */
public interface IAudioService extends IService<Audio> {

    /**
     * @Author 张雪
     * @Description 查询用户信息
     * @Date 2019/12/10 9:57
     **/
    List<SysUser> allotBefore(String username);
    /**
     * @Author 张雪
     * @Description 查询当前登录用户的所有下属用户
     * @Date 2019/12/10 9:58
     **/
    List<SysUser> selectAllWorker(String username);
    /**
     * @Author 张雪
     * @Description 批量分配
     * @Date 2019/12/10 16:10
     * @return 受影响行数
     **/
    int allotByIds(List<Long> ids);

    /**
     * @Author 张雪
     * @Description 根据id查DraftId 音频表
     * @Date 2019/12/12 0:04
     * @Param
     * @return
     **/
    Long selectDraftIdById(Long ids);


    /**
    * @Author//宋昱
     * @Description //未审核的Audio
     * @Date 2019/12/16 21:02
            **/
    List<Long> selectIdByAudio(Long userIdByUsernameAudio);


    Long selectIdByUsername(String currentUsername);

    /**
     * @Author//songyu
     * @Description //根据组号查询
     * @Date 2019/12/20 16:35
     **/
    List<String>selectByGroupid(String groupid);
/**
* @Author//宋昱
 * @Description //查下属id
 * @Date 2019/12/20 19:57
        **/
    List selectAllotNoId(Long userIdByUsernameAudio);

    /**
    * @Author//songyu
     * @Description //group表audio表查询
     * @Date 2019/12/20 20:34
            **/
    List<String>selectGroupid(Long allotNoid);
/**
* @Author//宋昱
 * @Description //根据组号查询状态
 * @Date 2019/12/20 23:45
        **/
    List<Integer> selectStatus(String groupid);

    /**
    * @Author//Songyu
     * @Description //TODO
     * @Date 2019/12/21 0:49
            **/
    String selectGroupidById(long id);

    /**
    * @Author//宋昱
     * @Description //TODO
     * @Date 2019/12/21 1:23
            **/
    List<Long> selectIdByGroupId(String groupId);

    /**
     * 刘雪奇
     */
    SysUser getUserByUserName(String username);

    int insertCheck(Check check);

    List<Long> getChildrenIdByParentId(Long id);

    Draft GetGroupIdById(Long id);

    Audio selectAGroupIdById(Long id);

    List<Check> getCheckById(Long id);

    List<Allot> getAllotDraftIdByUserId(Long userId);

    List<Allot> getDraftByAllotnoId(Long userId);

    SysUser getUserIdByUserName(String username);

    SysUser getUserNameByUserId(Long userid);

    Integer insertToAllot(Allot allot);

    Integer insertToGroup(Group group);

    List<Long> getChildrenNameByChildrenIdAudio (Long parentId);

    List<String> lookTitle(String username);

    IPage<Audio> listPage(@Param("page")IPage<Audio> page, QueryWrapper<Audio> queryWrapper);

    IPage<Audio> pageList(@Param("page")IPage<Audio> page, QueryWrapper<Audio> queryWrapper);
}
